﻿#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int erfen(int* p, int target,int n)
{
	int mid;
	int left = 0, right = n - 1;
	while(left <= right)
	{
		mid = left + (right - left) / 2;
		if (p[mid] > target)//右边的全部丢弃
		{
			right = mid - 1;
		}
		else if (p[mid] < target)
		{
			left = mid + 1;
		}
		else if (p[mid] == target)
		{
			return mid;
		}
		
	}
	return -1;

}
int main()
{
	int n,target;//这是一个左边闭区间，右边开区间；
	scanf("%d", &n);
	scanf("%d", &target);

	int* p = (int*)malloc(n *sizeof(int));
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &p[i]);
	}


	printf("%d", erfen(p, target,n));

	free(p);
	return 0;
}